package cn.lyq.card.ui.setting

import cn.lyq.card.base.SimpleVM
import cn.lyq.card.manager.UserManager
import cn.lyq.card.utils.EncryptUtils


class SettingVM : SimpleVM() {

    fun upLoginPwd(pwd: String, code: String) = simpleEmit {
        val pwdEncrypt = EncryptUtils.encryptPwd(pwd)
        repository.userService.upLoginPassword(UserManager.getPhone(), pwdEncrypt, code)
    }

    fun upPayPwd(pwd: String, code: String) = simpleEmit {
        val pwdEncrypt = EncryptUtils.encryptPwd(pwd)
        repository.userService.upWithdrawPassword(UserManager.getPhone(), pwdEncrypt, code)
    }
}